/**
 * Created with Intellij IDEA.
 * Description
 * User: wen
 * Date:2022-02-15
 * TIME:23:07
 */
public class TestDemo {
    public static int sumAdd(int n){
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum = sum + i;
        }
        return sum;
    }

    public static void add() {

    }
    public static void main(String[] args) {
        //int ret = sumAdd(10);
        //System.out.println(ret);
        System.out.println(sumAdd(10));
        //System.out.println(add());
        //这样打印函数必须有返回值
        System.out.println(sumAdd(10)*2);
        //函数的返回值支持链式调用
    }
}
